package com.ztjava.common.listener.record;

import com.jfinal.aop.Duang;
import com.jfinal.kit.Ret;
import com.ztjava.common.service.RecordService;
import com.ztjava.core.bean.sub.RecordBean;
import com.ztjava.plugin.event.EventTag;
import com.ztjava.plugin.event.core.ApplicationListener;
import com.ztjava.plugin.event.core.Listener;
import com.ztjava.plugin.event.core.RequestEvent;

@Listener(enableAsync = true,tag = EventTag.COMMON_RECORD)
public class InsertRecordListener implements ApplicationListener<RequestEvent>{
	private static RecordService recordService = Duang.duang(RecordService.class);
	@Override
	public Ret onApplicationEvent(RequestEvent event) {
		RecordBean recordBean = (RecordBean)event.getSource();
		recordService.insertRecord(recordBean);
		return null;
	}

}
